package icu.xblogs.report.mapper;

import icu.xblogs.report.domain.AttendanceRecord;
import icu.xblogs.report.domain.Employee;
import icu.xblogs.report.plugin.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Frank KONG
 * @version 1.0
 * @date 2020/11/16 13:16
 */
@Repository
public interface AttendanceRecordMapper {
    //查询所有
    List<AttendanceRecord> selectAll();
    //查询某日出勤记录
    List<AttendanceRecord> selectDay(String day);
    //查询某员工某日出勤记录
    AttendanceRecord selectOneDay(@Param("eid") int eid, @Param("day") String day);
    //查询某日出勤记录（分页）
    List<AttendanceRecord> selectDay(@Param("day") String day, Page page);
    //查询某日未出勤员工
    List<Employee> selectAbsenceDay(String day);
    //查询某日未出勤员工（分页）
    List<Employee> selectAbsenceDay(@Param("day") String day, Page page);
    //查询某月出勤记录
    List<AttendanceRecord> selectMonth(String month);
    //查询某员工某月的出勤记录
    List<AttendanceRecord> selectOneMonth(@Param("eid") int eid, @Param("month") String month);
    //查询某员工某月出勤数
    int countOneMonth(@Param("eid") int eid,@Param("month") String month);
    //查询某员工某月未迟到出勤数
    int countEarlyOneMonth(@Param("eid") int eid,@Param("month") String month,@Param("time") String time);
    //查询某员工某日期是否已经考勤
    int countByDate(@Param("id") int id, @Param("day") String date);
    //插入一条考勤记录
    void insertOneRecord(@Param("id") int id, @Param("accurate") String accurate, @Param("date") String date);
}
